import java.util.Scanner;

//数的划分
public class code1 {
    static int n;
    static int k;
    static int count=0;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        k = sc.nextInt();

        dfs(0, 1,0);
        System.out.println(count);
    }

    public static void dfs(int m, int last,int sum) {//m代表选取了m个数了;last表示遍历到哪个数了;sum代表目前已经累计多大的数了
        if (m == k) {//递归出口
            if (sum==n) count++;
            return;
        }
        for (int i = last; i <= n-sum; i++) {
            dfs(m+1,i,sum+i);
        }
    }
}
